package Day09;

import java.util.Scanner;

public class Demo02 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("输入年份：");
        int year = in.nextInt();
        System.out.println("输入月份：");
        int month = in.nextInt();
        System.out.println("输入日期：");
        int days = in.nextInt();
        int sumDay = days - 1;
        for (int i = 1900; i < year; i++) {
            if (((i % 4 == 0) && (i % 100 != 0)) || i % 400 == 0) {
                sumDay += 366;
            } else {
                sumDay = sumDay + 365;
            }
        }
            for (int i = 1; i < month; i++) {
                switch (i) {
                    case 1:
                    case 3:
                    case 5:
                    case 7:
                    case 8:
                    case 10:
                    case 12:
                        sumDay += 31;
                        break;
                    case 2:
                        if (((year % 4 == 0) && (year % 100 != 0)) || year % 400 == 0) {
                            sumDay += 29;
                        } else {
                            sumDay = sumDay + 28;
                        }
                        break;
                    default:
                        sumDay += 30;
                }

            }
            System.out.println("距1900年1月1日相差天数：" + sumDay);
        }
    }
